package com.sky.dto;

import com.sky.entity.DishFlavor;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel(value = "DishDTO", description = "菜品数据传输对象")
public class DishDTO implements Serializable {
    @ApiModelProperty(
            value = "菜品ID",
            example = "1",
            notes = "新增时留空，修改时必填"
    )
    private Long id;

    @ApiModelProperty(
            value = "菜品名称",
            example = "鱼香肉丝",
            required = true
    )
    private String name;

    @ApiModelProperty(
            value = "菜品分类ID",
            example = "1",
            required = true,
            notes = "对应菜品分类的主键ID"
    )
    private Long categoryId;

    @ApiModelProperty(
            value = "菜品价格",
            example = "38.5",
            required = true,
            dataType = "java.math.BigDecimal"
    )
    private BigDecimal price;

    @ApiModelProperty(
            value = "菜品图片路径",
            example = "dish/202308/123456.jpg"
    )
    private String image;

    @ApiModelProperty(
            value = "菜品描述",
            example = "传统川菜，酸甜微辣"
    )
    private String description;

    @ApiModelProperty(
            value = "销售状态",
            example = "1",
            allowableValues = "0,1",
            notes = "0: 停售，1: 起售（默认值1）"
    )
    private Integer status = 1; // 增加默认值

    @ApiModelProperty(
            value = "口味列表",
            example = "[{\"name\":\"微辣\",\"value\":\"微辣\"}]",
            dataType = "java.util.List<com.sky.entity.DishFlavor>"
    )
    private List<DishFlavor> flavors = new ArrayList<>();
}
